﻿using System.Collections.Generic;
using Might.Infrastructure.ModelicaDOM;
using Might.Infrastructure.DOM;

namespace Might.Modelica.Annotations.Graphics {
    ///<summary>
    ///</summary>
    [Mapping("Placement")]
    [AnnotationDOMGroup(GroupNames.Placements)]
    public class Placement {
        ///<summary>
        ///</summary>
        public Placement() {
            iconTransformation = new Transformation();
            transformation = new Transformation();
            visible = true;
        }

        ///<summary>
        ///</summary>
        ///<param name="visible"></param>
        ///<param name="transformation"></param>
        ///<param name="iconTransformation"></param>
        public Placement(
            bool visible, Transformation transformation, Transformation iconTransformation) {
            this.iconTransformation = iconTransformation;
            this.transformation = transformation;
            this.visible = visible;
        }

        ///<summary>
        ///</summary>
        [Mapping("iconTransformation")]
        public Transformation iconTransformation { get; set; }

        ///<summary>
        ///</summary>
        [Mapping("Transformation")]
        public Transformation transformation { get; set; }

        ///<summary>
        ///</summary>
        [Mapping("visible")]
        public bool visible { get; set; }

        [UnknownMapping]
        public List<object> UnknownItems { get; set; }

        public bool IsDefault {
            get {
                return iconTransformation.IsDefault &&
                       transformation.IsDefault &&
                       visible;
            }
        }
    }
}